<gm:page title="Demo - Defer authentication" authenticate="false" onload="init()">

  <script>
    function init() {
      if (google.mashups.isUserAuthenticated()) {
        document.getElementById('signInLink').style.display = 'none';
      } else {
        document.getElementById('signInLink').href = google.mashups.properties['loginURL'];
      }
    }
  </script>
  
  <div class="gm-app-header">
    <h2>Displaying the login screen when a link is clicked</h2>
  </div>
  
  <gm:list data="${app}/test" template="simple"/>
  
  <a id="signInLink" href="#" onclick="">Sign in to add entries</a>

</gm:page>